import * as employeeApi from '@/api/employee'

const state = {
  employeeList: {
    rows: [],
    total: 0
  }
}

const mutations = {
  SET_EMPLOYEE_LIST(state, newValue) {
    state.employeeList = newValue
  }
}

const actions = {
  async updateEmployeeList({ commit }, params) {
    // params: 三个选中的信息+当前页
    const res = await employeeApi.getEmployeeList(params)
    console.log(res);

    commit('SET_EMPLOYEE_LIST', res)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
